package com.ruoyi.product.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.product.mapper.ProductSwitchMapper;
import com.ruoyi.product.domain.ProductSwitch;
import com.ruoyi.product.service.IProductSwitchService;
import com.ruoyi.common.core.text.Convert;

/**
 * 开关机信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-01-12
 */
@Service
public class ProductSwitchServiceImpl implements IProductSwitchService 
{
    @Autowired
    private ProductSwitchMapper productSwitchMapper;

    /**
     * 查询开关机信息
     * 
     * @param deviceId 开关机信息主键
     * @return 开关机信息
     */
    @Override
    public ProductSwitch selectProductSwitchByDeviceId(String deviceId)
    {
        return productSwitchMapper.selectProductSwitchByDeviceId(deviceId);
    }

    /**
     * 查询开关机信息列表
     * 
     * @param productSwitch 开关机信息
     * @return 开关机信息
     */
    @Override
    public List<ProductSwitch> selectProductSwitchList(ProductSwitch productSwitch)
    {
        return productSwitchMapper.selectProductSwitchList(productSwitch);
    }

    /**
     * 新增开关机信息
     * 
     * @param productSwitch 开关机信息
     * @return 结果
     */
    @Override
    public int insertProductSwitch(ProductSwitch productSwitch)
    {
        return productSwitchMapper.insertProductSwitch(productSwitch);
    }

    /**
     * 修改开关机信息
     * 
     * @param productSwitch 开关机信息
     * @return 结果
     */
    @Override
    public int updateProductSwitch(ProductSwitch productSwitch)
    {
        return productSwitchMapper.updateProductSwitch(productSwitch);
    }

    /**
     * 批量删除开关机信息
     * 
     * @param deviceIds 需要删除的开关机信息主键
     * @return 结果
     */
    @Override
    public int deleteProductSwitchByDeviceIds(String deviceIds)
    {
        return productSwitchMapper.deleteProductSwitchByDeviceIds(Convert.toStrArray(deviceIds));
    }

    /**
     * 删除开关机信息信息
     * 
     * @param deviceId 开关机信息主键
     * @return 结果
     */
    @Override
    public int deleteProductSwitchByDeviceId(String deviceId)
    {
        return productSwitchMapper.deleteProductSwitchByDeviceId(deviceId);
    }
}
